Tank inventory and leak detection system

ABSTRACT

A controller including a digital processor is connected to flow meters and overfill gauges suitable for placement in the fill ports of underground storage tanks at, for example, a gasoline service station. The station dispenser pumps are also connected to the controller. In addition, probes, including tank liquid level probes, line pressure probes, and leak probes capable of detecting small quantities of liquid leaking from the system, are also connected to the controller. Processor software programs use stored decision criteria relating liquid conditions external of the storage tank system and liquid conditions internal of the storage tank system and its contents to provide audio and visual indications of the status of the liquid storage system and its contents.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The invention in general relates to liquid status detectors, such asthose that detect hydrocarbon liquid leaking from underground storagetanks, and in particular a detector that combines both internal tankinventory sensors and external leak sensors in a single system.

2. Description of the Prior Art

U.S. Pat. No. 4,221,125, on an invention of John N. Oliver and Louis M.Sandler, U.S. Pat. No. 4,646,069 issued to Raymond J. Andrejasich et al,U.S. Pat. No. 4,660,026 issued to Brian L. Chandler and U.S. Pat. No.4,116,045 on an invention of Bronson M. Potter, are exemplary of systemsfor detecting the presence of leaking liquid. Typically such systemsinclude leakage probes that are buried in the vicinity of hydrocarbonstorage tanks, placed between the walls of double-walled hydrocarbonstorage tanks, or otherwise placed externally of storage tanks to detectliquid leaking from the tanks. The probes are generally connected viawires to a central controller, which may be located, for example, in aservice station office, and which monitors the probe status. Inaddition, a wide variety of systems have been known for many years formeasuring the liquid level within tanks for the purposes of gauging theamount of liquid in the tank and or for detecting the leakage of liquidfrom the tank. See for example U.S. Pat. No. 2,775,748 issued to R. L.Rod, et al, U.S. Pat. No. 3,017,771 issued to F. R. Bonhomme, U.S. Pat.No. 4,571,987 issued to J. A. Horner, U.S. Pat. No. 4,604,893 issued toF. J. Senese, et al; U.S. Pat. No. 4,637,254 issued to J. F. Dyben, etal; U.S. Pat. No. 4,646,560 issued to J. W. Maresca, Jr., et al, andU.S. Pat. No. 4,646,569 issued to H. F. Cosser and European PatentApplication No. 1,106,677 on a disclosure of J. S. Haynes. The foregoingreferences reflect just a small portion of the available liquid levelmeasuring devices. Despite the extensive research and development thathas gone into liquid level gauging, the preferred method of takinginventory in underground storage tanks remains the dipstick. The presentinvention has for the first time combined external leak detectionsensors with internal level gauging sensors in a unique system whichresults in important advantages, particularly for underground gasolinestorage tanks, which system makes electronic inventory controlpractical.

SUMMARY OF THE INVENTION

It is an object of the invention to provide a liquid status detectorhaving both external leak detection sensors and internal liquid levelgauging sensors.

It is a further object of the invention to provide the above object in aliquid status detector in which the ability to detect small quantitiesof liquid external of a liquid storage tank enhances the ability of thesystem to accurately determine the amount of liquid in the system.

It is a further object of the invention to provide a liquid statusdetector in which sensors internal of a liquid storage system enhancethe ability of sensors external of the storage system to detect andlocate leaks in the storage system.

The invention provides a tank inventory and leak detection systemcomprising: external detection means for detecting one or moreconditions of liquid external of the storage system and for providing anexternal liquid signal; internal detection means for detecting one ormore conditions of liquid internal of the storage system and forproducing an internal liquid signal; means for storing decision criteriarelating one or more of the external liquid conditions and one or moreof the internal liquid conditions; and indicating means communicatingwith the means for storing and responsive to the external liquid signaland the internal liquid signal for providing an indication of the statusof the liquid storage system and its contents. The external detectionmeans preferably comprises a means for detecting the presence of a smallquantity of hydrocarbon liquid. The external detection means preferablyfurther comprises float means configured to fit within the collectingmeans and occupying the major portion of its volume at the liquid-floatinterface, and a sensing means attached to the float for providing theexternal liquid signal. Alternatively, the external detection meanscomprises a vapor sensor and a means for locating the vapor sensorbetween the walls of and near the bottom of a double-walled tank.Preferably the internal detection means comprises measurement means formeasuring the quantity of liquid in the storage system. Preferably themeasurement means comprises liquid level means for measuring the liquidlevel in the storage system and at least one temperature sensor meansfor sensing the temperature of the liquid in the storage system.Preferably the means for storing comprises means for storing decisioncriteria for determining the location of a leak in the liquid storagesystem and the indicating means includes means for indicating thelocation of a leak in the liquid storage system.

Heretofore, internal tank level gauging systems have not beentrustworthy. Relatively large level changes corresponding to significantvolume changes can be caused by relatively common changes in liquidtemperature, for example. As another example, standing waves betweenlayers of liquid at different temperatures can exist for relatively longperiods and disrupt sensing systems. Further, the most common form ofleakage, i.e., leakage from couplings and connecting piping may occurduring volume transfers which can mask them. However, it has beendiscovered that properly placed external leak detectors can detectminute quantities of leaking liquid. For example, it has been found thatleaked fluids tend to collect in sumps and small amounts, e.g, a cupful,can quickly be detected. In the present invention sensitive externalleakage sensors are used to check the internal gauging systemeliminating many false alarms which plagued previous systems. Numerousother features, objects and advantages of the invention will becomeapparent from the following detailed description when read inconjunction with the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

In the drawings:

FIG. 1A is a diagrammatic view of a preferred embodiment of a tankinventory and leak detector system according to the invention in atypical operating environment;

FIG. 1B is a block diagram of the preferred embodiment of the invention;

FIG. 2 is a block diagram showing details of the interconnection of thecontroller and probes shown in the embodiments of FIGS. 1A and 1B:

FIG. 3 shows a preferred format for a digital command output by thecontroller;

FIG. 4 is a block circuit diagram of the probe communications network ofthe embodiment of FIG. 2;

FIG. 5 is a detailed electrical circuit diagram of the communicationmodule of FIGS. 1, 2 and 4;

FIG. 6 is a block circuit diagram of the controller of FIGS. 1A and 1B;

FIG. 7 is a detailed circuit diagram of the controller command signalinterface shown;

FIG. 8 is a detailed circuit diagram of the controller status signalinterface;

FIG. 9 is a block diagram of a liquid level sensor module according tothe invention;

FIG. 10 is a block diagram of a leak sensor module according to theinvention;

FIG. 11 is a detailed electrical circuit diagram of an exemplarypreferred sensor module circuit board;

FIG. 12 shows the sensor elements which are connected to the circuitboard of FIG. 11 to form the sensor module of FIG. 9;

FIG. 13 shows the sensor elements which are connected to the circuitboard of FIG. 11 to form the sensor module of FIG. 10;

FIG. 14 shows an exemplary well and float for detecting minutequantities of leaking liquid;

FIG. 15 shows an exemplary vapor detection sensor and the means forlocating it between the walls of a double-walled tank;

FIG. 16 shows an exemplary placement of the sensor of FIG. 15 betweenthe walls of a double-walled tank;

FIG. 17 is a flow chart showing the preferred main microprocessorprogram according to the invention;

FIG. 18 is a block diagram of the preferred fill flow unit;

FIG. 19 is a flow chart showing the preferred Monitor Mode sub-program;

FIG. 20 is a flow chart showing the preferred line pressure probe checksub-program;

FIG. 21 is a flow chart showing the preferred external probe checksub-program;

FIG. 22 is a flow chart showing the preferred annular space probe checksub-program;

FIG. 23 is a flow chart showing the preferred tank inventory portion ofthe main program; and

FIG. 24 is a flow chart showing the preferred alarm program.

DESCRIPTION OF THE PREFERRED EMBODIMENT

FIG. 1A illustrates the preferred embodiment of the invention as it maybe installed at a gasoline station. FIG. 1B is a block circuit diagramof the preferred embodiment of the invention. A controller 40, whichpreferably includes a computing unit 43, a printer 41, a display 42, anaudible-alarm 45, relays 44 and keyboards 92, is located in an office inservice station 33. The controller 40 receives inventory input data overtransmission line 32, inventory output data over transmission line 31,and liquid status information over transmission line 30. A flow unit 22includes a flow meter 22A located in tank fill port 28 and an overflowgauge 22C, which provide inventory input data to controller 40 via line32. Flow meters such as 21A, in pumps 21 provide inventory output datato controller 40 via line 31. Sensing probes, such as 23 through 27,detect the status of their environment and provide signals overtransmission line 30 to the controller 40. Some probes, such as 24 and27 extend down wells, such as 36 and 37 respectively, external togasoline tanks 39A, 39B and 39C. Others such as 26, are placed betweenthe walls 38A and 38B of a double-walled tank such as 39C. Other probes,such as 25 extend inside the tanks to measure the liquid level in thetanks. Still other probes, such as 23 measure the pressure in liquidtransfer pipes such as 34. The invention contemplates that other typesof probes may also be used. For simplicity, only exemplary probes areshown in FIG. 1B.

Each probe includes a probe communication module, such as 24B and 25B, atypical one of which is shown in FIGS. 2 and 4 at 29B. Each probe alsoincludes a sensor module, such as 24C and 25C, a typical one of which isshown in FIGS. 2 and 4 at 29C. As will be seen in detail below, eachcommunication module is essentially identical while the sensor modulemay vary widely depending on the particular physical condition it isintended to detect.

In the preferred embodiment inventory data is provided to controller 40by flow meters in pumps 21 and in delivery ports such as 28 wheneverliquid is added to or removed from the tanks 39A, 39B and 39C. Probedata is requested by the controller 40 via a command signal at frequentintervals. The command signal preferably comprises a probe identifiersignal and a data signal formatted as shown in FIG. 3. The commandsignal is passed along transmission line 30 from the controller 40 tothe probe communicator modules, such as 29B. The signal is decodedwithin the communication module (see FIG. 44) and the data signal ispassed to the sensor module such as 29C. Typical sensor modules areshown in FIGS. 9 and 10. In these modules the data signal is passed viadata input lines such as 48 and 148 to a multiplexer 134. Sensors suchas 130, 131, 132, 140 and 141 in the sensor modules provide statussignals to the multiplexer 134 over channels 136 and 146. Theinformation in the data signal tells the multiplexer which data channelto select, and the multiplexer applies the signal on the selectedchannel to a voltage to frequency converter such as 135 and 147, whichconverter outputs an oscillating signal which is applied to the probeoutput -SO (FIGS. 2, 4 and 5) through the communication module 29Bswitch 63 when the identifier signal which agrees with a local probeaddress is applied to decoder 60.

Upon receiving the oscillating signal from the probes, the controllerstatus signal interface 96 (FIG. 6) counts the number of oscillationsoccurring over a predetermined time period and presents the count to aprocessor 90 which utilizes decision criteria stored in memory 91 toprovide an indication of the system status which may take the form ofmessages on printer 41 or liquid crystal display 42, an alarm on audioalarm 45, an external alarm via relays 44 which may activate a recordedmessage on phone 46 or speaker 47, or a report on an external dataterminal 49. Or the status signals in combination with the decisioncriteria could cause the processor to trigger a pump 48 to removeleaking pollutants. Keyboards 50 and 51 on controller 40 may be used toinput data, commands and otherwise communicate with the system.

Turning now to a more detailed description of the preferred embodimentof the invention, FIG. 2 shows the interconnection between the probesand the controller. The controller 40 is connected to the probes via atransmission line 30 which in the preferred embodiment is a six-wirecable. Each probe, such as 29, preferably includes a junction box, suchas 29A, a communication module, such as 29B, and a sensor module, suchas 29C. Preferably the junction box (29A) and the communication module(29B) are identical for each probe. The sensor module may be a liquidsensor in a well such as 35 (FIG. 1A), a liquid level sensor such as25C, a between-the-wall vapor sensor such as 26B, a line pressure sensorsuch as 23C, or any one of a number of different liquid status sensors.Examples of such sensors are described below in reference to FIGS. 9-16.Communications modules are shown at 24B, 25B and 26B in FIG 1A. Thejunction boxes are not shown in FIG. 1A as the scale is not sufficientto show them clearly. The junction box and the communication module willbe discussed in terms of the junction box 29A and communication module29B, although it is understood that these portions are preferably thesame for all probes. The preferred communication module is discussedbelow with reference to FIGS. 2, 4 and 5. The controller includes apositive power output terminal (+PO), a negative power output terminal(-PO), a positive identifier signal output terminal (+IO), a negativeidentifier signal output terminal (-IO), a positive status signal inputterminal (+SI), and a negative status signal input terminal (-SI). Thejunction box 29A includes, at the left, positive and negative inputpower terminals (+PI, -PI), positive and negative identifier signalinput terminals (+II, -II), positive and negative status signal outputterminals (+SO, -SO) each of which are connected to the correspondingterminal on the controller (+PI to +PO, -PI to -PO, +II to +IO, etc.).On the right the junction box includes positive and negative poweroutput terminals (+PO, -PO), positive and negative identifier signaloutput terminals (+IO, -IO) and positive and negative status signalinput terminals (+SI, -SI) which are connected to the correspondingterminals on the next junction box (+PO to +PI, -PO to -PI, +IO to +II,-IO to -II, +SI to +SO and -SI to -SO). The junction box terminals areconnected to the communication module as will be clear from thediscussion of FIGS. 4 and 5.

In the preferred embodiment, the identifier signal is part of a 16-bitdigital Manchester encoded command sent by the controller 40 to theprobes. The format for this command is shown in FIG. 3. The first fourbits and the eleventh and twelfth bits are fixed. AO through A4represent the identifier signal. Up to 32 probes may be addressed bythese 4 bits. DO through D3 represent a data word which may be used tocontrol the sensor module. This word may be used to address one ofsixteen data channels.

FIG. 4 shows a block circuit diagram of the system communicationnetwork. The communication network portions of the controller includeoptocoupler 54, transistor 55 and resistors 56, 57, 58 and 59. Resistor59 is connected between the Vcc internal power source (an approximately5 volt power supply) of the controller and +IO output terminal. Thecollector of transistor 55 is connected to the -IO output terminal. Theemitter of transistor 55 is connected to ground and the base isconnected to ground through resister 57 and to the identifier signal(digital word) output through resister 58. The positive status signalinput terminal (+SI) is connected to the anode of the optocoupler diode,and the negative status signal input terminal (-SI) is connected to thecathode. The emitter of the optocoupler is connected to ground while thecollector is connected to the Vcc power supply through resistor 56 andto the status signal input.

The communication module includes decode circuitry 60, decrementcircuitry 61, encode circuitry 62, optocouplers 64 and 65, inverters 66,67, 68 and 69 and resistors 73, 74, 75 and 76. The identifier signalinput terminals +II and -11 are connected across the optocoupler 64diode with the positive connected to the anode and the negativeconnected to the cathode. The emitter of optocoupler 64 is connected tothe probe ground and the collector is connected to the probe powersupply Vbb (an approximately 5 volt power source) through resistor 74and to the input of inverter 69. The output of inverter 69 is connectedto the input of the decode logic 60. The decode logic compares the 5-bitprobe identifier address AO through A4 to the local address, and if itmatches, places a signal on the select (sel) output which is applied toswitch 63 to cause it to switch to the local probe status in line. Ifthe identifier address does not match the local address it is sent todecrement logic 61 where it is decremented by one and passed to theencode logic 62. A signal is also placed on the select output to causeswitch 63 to switch to the status signal probe input. The data word DOthrough D3 is passed to the encode logic and to the sensor module datainput. The decode logic also checks the digital data word for validity,and if it is valid, it places a signal on the data valid output which isapplied to the encode logic 62 to cause it to apply the encoded signalto the input of inverter 66. The output of inverter 66 is connected tothe -IO terminal. The +IO terminal is connected to the Vbb power sourcethrough resistor 76. The +SI terminal is connected to the anode of theoptocoupler 65 diode and the -SI terminal to its cathode. The emitter ofthe optocoupler 65 is connected to ground and the collector is connectedto the Vbb source through resistor 75 and to the input of inverter 67.The output of inverter 67 is connected to the status signal probe inputof switch 63. The output of switch 63 is connected to the input ofinverter 68. The output of inverter 68 is connected to the -SO terminal,and the +SO terminal is connected to the Vbb power source throughresistor 73.

FIG. 5 is a detailed electrical circuit diagram of the communicationsmodule. In addition to the parts discussed in reference to FIG. 4, thecircuit includes a DC to DC converter 82, and inverters 83 and 84. Thedecode logic 60 and decrement logic 61 are implemented together usingdecoder 77, shift registers 78 and 79 and adders 80 and 81. The encodelogic comprises encoder 62. The +PI and -PI inputs are connected to a DCto DC converter which provides isolation of the probe power supply, andground isolation between probes. The DC to DC converter also permits aninput voltage of 24 VDC. This higher distribution voltage reduces thecurrent drain of each probe on the distribution system, thereby reducingthe IR losses in the transmission line 30, allowing the use of moreprobes. The outputs of the converter 81 provide the probe power sourceVbb and the probe ground. The numbers within the rectangles representingthe IC chips 77, 78, 79, 80, 81 and 62 indicate the inputs/outputs ofthose chips which are explained in the literature provided with theparticular chips (see below). The output of inverter 69 is connected tothe SI input of decoder 77. The DV output of decoder 77 is connected tothe SDI input of encoder 62. The SO and DC outputs of decoder 77 areconnected to the D and CLK inputs respectively of shift register 78. TheDC output is also connected to the CLK input of shift register 79. TheDRS output of decoder 77 is connected to the MR inputs of shiftregisters 78 and 79 through inverter 83. The Dl through D15 inputs ofdecoder 77 are connected to ground. The Q7 output of shift register 78is connected to the D input of shift register 79 while the Q6 output isconnected to the AO input of adder 81. The QO through Q3 outputs ofshift register 78 are connected to the D12 through D15 inputs of encoder62 and also to the sensor module terminal block 87 with the D3 (QO) linebeing inverted by inverter 84. The QO through Q3 outputs of shiftregister 79 are connected to the A3 through AO inputs respectively ofadder 80. The BO through B3 inputs of adders 80 and 81 are connected tothe Vbb voltage source. The Sl through S4 outputs of adder 80 areconnected to the D4 through D7 inputs respectively of encoder 62. The CIinput of adder 81 is grounded. The CO output of adder 81 is connected tothe CI input of adder 80 while the Sl output is connected to the D9input of encoder 62. The DO output of encoder 62 is applied to the inputof inverter 66. The sensor module ground and voltage source inputs areconnected to the communications module ground and voltage source, Vbb,respectively through terminal block 87. The other connections are asdiscussed in reference to FIG. 4.

In the preferred embodiment, encoder 62 is a Manchester coder/decoderSupertex type ED9, adders 80 and 81 are 4-bit adders NationalSemiconductor type 74HC283, shift registers 78 and 79 are RCA typeCD74HC164, decoder 77 is a Supertex type ED5 Manchester coder/decoder,optocouplers 54, 64 and 65 are Texas Instruments type TIL153's,transistor 55 is a type PN2222, the inverters 66 through 69 and 83 and84 are a National Semiconductor Schmitt hex inverter type 74HC14, DC toDC converter 81 is a 24 volt to 5 volt converter, resistors 57, 59, 73,and 76 are 1K ohm, 58 is a 2K ohm resistor, resistors 56, 73, 74 and 75are 10K ohm, and switch 63 is a quad multiplexer type CD74HC157 fromRCA.

FIG. 6 shows a block circuit diagram of the preferred embodiment of thecontroller 40. It comprises a processor 90, a memory 91, keyboards 92,outputs 93, command signal interface 95, status signal interface 96,flow unit interface 97, and pump meter interface 98. The processorreceives instruction from keyboards 92, data from interfaces 96, 97 and98, and utilizes decision criteria stored in memory 91 to activateappropriate outputs 93. The processor 90, memory 91, keyboards 92 andoutputs 93 may be any one of a number of such components that arewell-known in the art; as for example the processor, memory, keyboards,displays, etc. described in U.S. Pat. Nos. 4,736,193 and 4,740,777 oninventions of Laurence S. Slocum and Sara M. Mussmann for ProgrammableFluid Detectors. Thus, these components will not be discussed furtherherein. The command signal interface 95 and status signal interface 96are, however, unique in the field of fluid detectors and therefore willbe described in detail. The flow unit interface 97 and the and the pumpmeter interface 98 are conventional RS-232 interfaces and will not bediscussed further herein.

FIG. 7 shows the detailed circuit diagram for the command signalinterface 95. It comprises parallel interface adapter 100, transmitter101, resistors 103, 57, 58 and 59, and capacitors 104 and 105. Thenumbers on the integrated circuits, such as parallel interface adaptor100, near the connecting lines refer to the pin numbers of the circuits,while the letters in the interior refer to the internal signals. Thenumbers 5, 8, 9 and 27 through 36 pins of the parallel interface adapterare connected to the data and timing outputs of the processor asappropriate to transmit the probe address and sensor module data. Thenumber 6 pin is connected to the device enable circuitry associated withthe processor. The number 1 through 4 pins of adapter 100 are connectedto the 7 through 10 pins respectively of transmitter 101. The number 40pin of adapter 100 is connected to the number 6 pin of transmitter 101.The number 18 through 21 pins of adapter 100 are connected to the 14through 11 pins respectively of transmitter 101. The number 14 pin ofadapter 100 is connected to the number 4 pin of transmitter 101. Thenumber 3 pin of transmitter 101 is connected to the system voltagesource, Vcc, through capacitor 105, and the number 15 pin is alsoconnected to the Vcc voltage. The number 18 pin of transmitter 101 isconnected to the number 2 pin through capacitor 104 and to the number 1pin through resistor 10. The number 16 pin of transmitter 101 and thenumber 26 pin of adapter 100 are connected to the Vcc voltage and thenumber 17 pin of transmitter 101 and the number 7 pin of adapter 100 areconnected to ground. The number 5 pin of transmitter 101 provides theoutput command signal to the probes which is also the Identifier SignalOutput shown in FIG. 4.

The command signal interface circuit 95 works as follows. The parallelinterface adapter 100 is connected to the processor and other elementsof the circuit so as to provide the probe address (identifier signal) onits PAO through PA4 outputs and the sensor data signal on its PBOthrough PB3 outputs. Pin 14 of the adapter 100 strobes the transmitter101 when the identifier signal and sensor signal is at the adapteroutputs and transmitter 101 then transmits the signal as a Manchesterencoded serial digital signal on output pin 5. The circuit comprisingtransistor 55 and resistors 57 and 58 is a buffer circuit, while thecircuit comprising resistor 103 and capacitors 104 and 105 is an RCclock which provides the timing for transmitter 101. In the preferredembodiment parallel interface adapter 100 is a type 82C55A andtransmitter 100 is a type ED-9 Manchester transmitter while resistor 103is 40K ohms and capacitors 104 and 105 are 1,000 picofarads and 100picofarads respectively which provide a 10K hertz timing signal.

Turning now to FIG. 8, the detailed circuitry for the status signalinterface 96 is shown. It includes parallel interface adapter 110,counters 111 and 112, one-shot latches, 115 and 116, counter 117,Schmitt-trigger inverters 119 and 120, resistors 56, 122 and 125 andcapacitors 123 and 124. The numbers 5,8,9, 17, and 27-36, pins ofadapter 110 are connected to the processor 90 and the number 6 pin isconnected to the chip select circuitry associated with processor 90. Thenumber 26 pin of adapter 110 is connected to the Vcc voltage, while thenumber 7 pin is connected to ground. The 1 through 7 pins of counter 112are connected to the 3, 2, 1, 40, 39, 38 and 37 pins respectively ofadapter 110. The number 15 pin of counter 112 is connected to the number4 pin of adapter 110, while the number 15 pin of counter 111 isconnected to the number 18 pin of adapter 110. The number 1 through 7pins of counter 111 are connected to the 19 through 25 pins respectivelyof adapter 110. The number 13 and 16 pins of adapter 110 are connectedto the Q output of latch 116. The number 10 pin of adapter 110 isconnected to the reset inputs of latches 115 and 116 and to the input ofinverter 120. The number 16 pins of counters 111 and 112 are connectedto the Vcc voltage while their number 8 and 14 pins are connected toground. Their number 10 pins are each connected to the Q output of latch116, their number 11 pins to the output of inverter 119, and theirnumber 13 pins to the Q output of latch 115. The number 12 pin ofcounter 112 is also connected to the Q output of latch 115 while thenumber 12 pin of counter 111 is connected to the number 9 pin of counter112. The CX output of latch 115 is connected to its R/C input throughcapacitor 124, while the CX output of latch 116 is connected to its R/Cinput through capacitor 123. The R/C input of latch 115 is alsoconnected to the Vcc voltage through resistor 125 while the R/C input oflatch 116 is also connected to Vcc through resistor 122. The B inputs oflatches 115 and 116 are connected to the Vcc voltage. The A input oflatch 115 is connected to the Q7 output (number 3 pin) of counter 117while the A input of latch 116 is connected to the Q output of latch115. The number 14 pin of counter 117 is connected to Vcc while itsnumber 7 pin is grounded. The clock input (number 1 pin) of counter 117is connected to the processor timer function, TMROUTO. The reset inputof counter 117 is connected to the output of inverter 120. The input ofinverter 119 is connected to the number 5 pin of optoisolator 54, whichprovides the Status Signal In signal shown in FIG. 4.

The status signal interface operates as follows: After processor 90, asdescribed above in reference to FIG. 7, sends a command to a probeasking for its status, it waits a time long enough for the command to goout along the probe communication network and the probe that wasaddressed to report the status requested. It then addresses the parallelinterface adapter 110 causing it to strobe the reset inputs of thecounter 117 and latches 115 and 116. This causes the latches to turn onthe counters 111 and 112 to begin reading the frequency coming in on the+SI input terminal and counter 117 to begin clocking a time period overwhich the frequency will be read. The time is controlled by theprocessor via the TMROUTO function. If the processor is asking for astatus that requires a high resolution reading of the SI signal comingin, it will put allow frequency signal as TIMROUTO, and if it is askingfor a status that requires a low resolution reading, it will put ahigher frequency signal as TMROUTO. The counter 117 will then count fora predetermined number of counts which define length of time period overwhich the SI signal will be read. When counter 117 times out, itactivates the one-shots 115 and 116 which shut down the counters 111 and112. The processor then tells the parallel interface adapter 110 to readthe count of counters 111 and 112, which are connected to operate as asingle 16 bit connector, which the adapter does and reports the countread back to the processor 90. It then signals the processor it isfinished via the INT2 signal output on pin 17.

The count of counters 111 and 112 which is reported to the processor 90is a digital signal related to the frequency of the voltage controlledoscillator 135, 147 in the probe in which the fluid status was sensed.The microprocessor uses the TMROUTO frequency to determine an absolutevalue of the oscillator frequency. For example the inverse of theTMROUTO frequency is proportional to the period over which the voltagecontrolled oscillator frequency was read. If he count of counters 111and 112 is multiplied by the inverse of TMROUTO, a number is obtainedwhich is proportional to the average oscillation frequency of the VCO,or average of the status signal, over the period. If the lower TMROUTOfrequency is output by the processor, then the period will be longer andthe number of oscillations averaged over will be greater and theresolution of the status signal will be higher. The processor 90utilizes the digital status signal to provide an indication of thesensed condition as will be discussed below.

In the preferred embodiment, parallel interface adapter 110 is a type82655A, counters 111 and 112 are each type 74HC590 eight- bit counters,latches 115 and 116 are type 74HC221, counter 117 is a 74HC4020,inverters 119 and 120 are 74HC14's, resistors 122 and 125 are each 2Kohms and capacitor 123 and 124 are each 1000 picofarads.

The flow meters 21A in pumps 21 are conventional digital meters as arecommonly used in service stations. Such meters are designed tocommunicate via a conventional RS-232 interface 98 which is well-knownin the art.

Turning now to the description of an exemplary sensor module, FIG. 9shows a block circuit diagram of a liquid level sensor module, such as25C. This module includes a liquid level sensor 130, a water sensor 131,temperature sensors 132, multiplexer 134, and voltage to frequencyconverter 135. Each of the sensors 130, 131, and 132 apply voltagesignals to multiplexer 134. The data input lines 148 from terminal block87 are also connected to multiplexer 134. Responding to the data signalson lines 148 which originated in the controller 40, the multiplexerplaces on converter 135 the voltage corresponding to the statusrequested by the controller. Converter 135 converts the voltage to afrequency signal which is the status signal, and outputs the statussignal to the local probe status terminal of terminal block 87. Thissignal comprises an internal liquid signal.

FIG. 10 shows a block electrical circuit diagram of another exemplarysensor module, a sensor intended to be placed in a well, such as 36(FIG. 1), and which differentiates between water, hydrocarbon and air.This module includes a water/hydrocarbon sensor 140, a liquid/gas sensor141, logic circuit 142, analog switch 143, voltage divider 144,multiplexer 134, and voltage to frequency converter 147. The sensors 140and 141 each apply voltage signals to logic circuit 142 which determinesif hydrocarbon, water or air is present and applies a signal indicativeof which is present to analog switch 143. Voltage divider 144 employinga reference voltage level from converter 147, generates three analogvoltage levels which are applied to switch 143. Switch 143 applies oneof the voltage levels, which is determined by the input from logiccircuit 142, to multiplexer 134. The data signal from controller 40 isapplied to multiplexer 134 via data input lines 148. Converter 147 alsoapplies a temperature signal indicative of the temperature of the ICchip to multiplexer 134. In response to the data command from controller40 and using a reference voltage from voltage to frequency converter147, multiplexer 134 places one of the voltages provided by the divider144 or the temperature signal voltage to converter 147 which converts itto a frequency signal and applies this signal to the local probe statusterminal of terminal block 87. This signal comprises an external liquidsignal.

In the preferred embodiment of the invention, the liquid level sensormodule of FIG. 9 and the liquid sensor module of FIG. 10 are implementedon a single circuit board which is shown in FIG. 11. Different circuitsare connected on the board and different components are connected to theboard via terminal block connector 150A to provide the two differentsensor modules. The components that are connected to terminal block 150Ato form the liquid level sensor of FIG. 9 are shown in FIG. 12, whilethe components that are connected to the terminal block 150A to form theliquid sensor module of FIG. 10 are shown in FIG. 13.

Referring to FIG. 12, in the preferred embodiment the sensor for theliquid level module comprises temperature sensors 210, 211, 212, liquidlevel sensor 215, conducting electrode tips 217 and 218 and connector150B. The temperature sensors 210, 211 and 213 are preferably located atdifferent depths of tank 39C, the level sensor is mounted vertically inthe tank, and the conducting tips 217 and 218 are located at or near thebottom of the tank. The wires 219 connect the sensor and the connector150B which plugs into converter 150A in the probe sensor module circuitboard located at the top of probe sensor module 25C.

Referring to FIGS. 13 and 14 the liquid sensor module sensors includeconducting electrode tips 221 and 222 mounted on a float 225 which islocated in a well, such as 36, external to the tanks 39A, 39B and 39C.The wells, such as 36, are located and the fill is placed around them sothat any liquid leaking from a tank will seep into the well. The float225 is free to move up and down the well as the liquid level in the wellrises and falls, and the conducting tips 221 and 222 are mounted on thefloat so that they extend into the upper portion of the liquid 226. Afloat switch 224 is mounted in the float and the switch and conductingtips 221 and 222 are connected by wires 228 to connector 150C whichplugs into connector 150A mounted in the circuit board located near thetop of the well. The float 225 is designed so that most of the volume ofthe well at the level of the liquid surface 227 is occupied by the bodyof the float. Thus, especially if ground water is present, a very smallamount of hydrocarbon (or other liquid that floats on water), forexample a cup or so, will be sufficient to activate the leak probe.

A vapor sensor type leak probe 26 is shown in FIG. 16 being installed ina double-walled tank. In this probe the sensor module 26C includes asensor unit 232 which is placed between the walls 233, 234 of thedouble-walled tank and electronics in a probe cap 245. Sensor unit 232is shown in FIG. 15 together with means 231 for inserting the sensorunit between the walls of a double-walled tank. The sensor unit 232contains the vapor sensor element, the unit having openings 233 forvapor to reach the sensor element. A cable 235 and a fish 226 provide ameans 231 to install the sensor unit 232 between the walls 243, 244 of adouble-walled tank. An electrical cable 237 connects the sensor unit 232to the rest of the sensor module 230 and the probe communication module239 which are contained in the cap 245 which closes the port 240 throughwhich the sensor is inserted. Vapor probes 26 installed as shown havebeen found to be able to sense small leaks, involving less than a cupfulof hydrocarbon, between the walls of a double-walled tank. The signalprovided by vapor probe 26 is an external liquid signal.

A detailed electrical circuit diagram of the preferred sensor modulecircuit board is shown in FIG. 11. The circuit includes multiplexer 134,logic/analog switch 1.C. 151 which functions both as logic circuit 142and analog switch 143, voltage to frequency converter 135, voltage tofrequency converter 147, inverters 152 through 157, constant currentdiode 160, diodes 161 and 162, potentiometers 165 through 170,capacitors 171 through 176, resistors 180 through 198, jumpers 201, 202,203, and connectors 87B and 150A. The GD or ground pin of connector 87Bconnects to the board system ground while the Vbb pin connects to thesystem voltage line. The status pin connects to the number 9 pin ofconverter 147, the number 14 pin of converter 135 and the Vbb voltagethrough resistor 185. The DO data input of connector 87B connects to thenumber 11 pin of multiplexer 134 and the number 11 pin of logic/switch151 through jumper 201. Note that the solid line on jumpers 201, 202 and203 indicates the connection for the level sensor module of FIG. 9,while the dotted line indicates the connection for the liquid sensormodule of FIG. 10. Logic/switch 151 and converter 147 are not requiredfor the level sensor module of FIG. 9 and may be omitted in the boardsfor the module, while converter 135 is not required for the fluid sensormodule of FIG. 10 and may be omitted in boards intended for that module.Data input Dl is connected to pin 10 of multiplexer 134 and to pin 10 oflogic/switch 151 through jumper 203. Data input D2 is connected to pins9 of multiplexer 134 and logic/switch 151. Data input D3 is connected tothe number 6 pin of logic/switch 151 through jumper 202, while datainput D3 is connected to pin 6 of multiplexer 134. The conducting tipinput pin C of connector 150A is connected to the input of inverter 154and the anode of diode 161 through capacitor 175; the input of inverter154 is also connected to the Vbb voltage through resistor 186. Inverters152, etc. are a hex inverter chip, the voltage input of which isconnected to the Vbb voltage and the ground of which is grounded. Theoutput of inverter 153 is connected to the input of inverter 152 throughcapacitor 173, while the output of inverter 152 is connected to theinput of inverter 153 and also is connected to its own input throughresistor 181. The output of inverter 153 is connected to the cathode ofdiode 161 and the anode of the diode is connected to the input ofinverter 154. The output of inverter 154 is connected to the input ofinverter 155, and the output of inverter 155 is connected to the anodeof diode 162. The cathode of diode 162 is connected to the input ofinverter 156, to ground through capacitor 176, and also to groundthrough resistor 194. The output of inverter 156 is connected to theinput of inverter 157. The output of inverter 157 is connected to thenumber 5 pin of multiplexer 134 through resistor 196, and the same pinis also connected to ground through resistor 195. The output of inverter157 is also connected to pin 10 of logic/switch 151 through jumper 203in the liquid sensor module embodiment. One side and the adjustablecontact of each of potentiometer 168, 169 and 170 is connected to groundwhile the other side is connected to pins 14, 15 and 12 respectively ofmultiplexer 134 through resistors 187, 188 and 189 respectively; pins14, 15 and 12 are also connected to the numbers 1, 2, and 3 temperatureinputs (Tl, T2 and T3) of connector 150A. The level 1 input, L1, ofconnector 150A is connected to the number 1 pin of multiplexer 134 andto the Vbb voltage through constant current diode 160, with the cathodeof the diode toward the level 1 input. The level 2, L2, input ofconnector 150A is connected to the number 13 pin of multiplexer 134 andalso to ground through resistor 197. The float switch input, F, ofconnector 150A is connected to the number 11 pin of logic/switch 151through jumper 201 in the liquid sensor module embodiment, and also tothe Vbb voltage source through resistor 198. The V and G pins ofconnector 150A are connected to the Vbb voltage and ground respectively.The number 13 and 15 pins of logic/switch 151 are connected to groundthrough resistor 191 and also connected to its number 12 pin throughresistor 193. The number 12 pin is also connected to the number 14 pinthrough resistor 192; the number 14 pin is also connected to the number4 pin of multiplexer 134, to the adjustable input of potentiometer 166,and to the number 4 pin of converter 147 through resistor 190. Thenumber 7 and 8 pins of logic/switch 151 and multiplexer 134 are allgrounded, while the number 16 pin of each are connected to the Vbbvoltage. The number 3 pins of each are connected to the number 2 pin ofconverter 147 and the number 5 pin of converter 135. The number 2 pin ofmultiplexer 134 is connected to the number 6 pin of converter 135 and tothe number 3 pin of converter 147. The number 1 pin of converter 147 isconnected to ground through resistor 180, the number 5 and 10 pins aregrounded and the number 6 pin is connected to the number seven pinthrough capacitor 171. The number 8 pin of converter 147 is connected tothe adjustable input of potentiometer 165 and to pin 13 of converter135. The two sides of potentiometer 165 are connected to pins 9 and 10respectively of converter 135. Pin 13 of converter 135 is also connectedto the Vbb voltage through resistor 184 and to ground through capacitor174. Pin 11 of converter 135 is connected to pin 12 through capacitor172. Pins 3 and 4 of converter 135 are connected to one side ofpotentiometer 167 through resistor 183. The other side of potentiometer167 is connected to ground. The adjustable input of potentiometer 167 isconnected to ground. Pins 1 and 8 of converter 135 are also connected toground. Pin 7 of converter 135 is connected to one side of potentiometer166, while the other side of the potentiometer is connected to groundthrough resister 182.

In the preferred embodiment of the invention multiplexer 134 andlogic/analog switch 151 are type CD4051BCN multiplexers, voltage tofrequency converter 147 and 135 are type AD537JH- V/F convertersavailable from Analog Devices, inverters 152 through 157 are implementedin a single hex inverter type CD4069CN, diodes 161 and 162 are of typeIN914's, constant current diode 160 is a type IN5297, potentiometer 165is a 20K ohm, 15 turn potentiometer, 166 is a 10K ohm, 15 turnpotentiometer, 167 is a 200K ohm, 15 turn potentiometer, 168, 169 and170 are 100 ohm, 15 turn potentiometers, capacitors 172, 173, 174, 175and 176 are 0.01 microfarad, 4700 picofarad, 10 microfarad, 0.1microfarad and 1 microfarad respectively. Resistors 180 through 198 are1K ohm, b 220K ohm, 60.4K ohm, 909 ohm, 100 ohm, 5K ohm, 270K ohm, 953ohm, 953 ohm, 953 ohm, 24K ohm, 24K ohm, 24K ohm, 24K ohm, 100K ohm, 10Kohm, 90K ohm, 10 ohm, and 100 K ohm respectively. In the preferredembodiment of the sensors of FIG. 12 and 13 the temperature sensors 210,211, and 212 are type AD590 temperature sensors available from AnalogDevices, level sensor 215 is preferably a Metritape™ level sensoravailable from, Metritape, Inc., P. O. Box 2366, Littleton, Mass. 01460,the float 225, float switch 224, and conducting electrode tips 221 ofthe fluid sensor of FIG. 13 are a float assembly of the type used withthe FD probe series (FD241R, FD 241S, FD241P) available from PollulertSystems, Inc., P.O. Box 706, Indianapolis, IN 46206-0706 and asdescribed in U.S. Pat. No. 4,442,405 issued to Raymond J. Andrejasich.The conducting electrode tips 217 and 218 are electrodes as described inthe foregoing patent, preferably made of stainless steel or platinum,and connectors 150A, 150B and 150C are preferably stake and headerconnectors while connectors 87A and 87B are preferably 1510D male andfemale connectors, or both connectors may be hard wired.

Turning now to a summary of the function of the liquid level sensormodule of FIGS. 9, 11 and 12 in conjunction with the controller 40 andprobe communication system, the liquid level sensor has the principalfunction of measuring the liquid level in a storage tank such as 39C. Italso measures the temperature at three depths along the sensor. Water inthe storage tank is detected via conductance electrodes 217 and 218installed at the bottom of the level sensor module 25C. The liquid levelis transduced into an analog signal by the Metritape™ level sensor 215which may be described as a long variable resistor the submerged part ofwhich is short-circuited by hydrostatic pressure of the liquid in whichit is immersed. The temperature sensing is accomplished by two-terminalelectronic devices 210, 211 and 212 which conduct current in directproportion to their absolute or Kelvin temperature. Two referencevoltages, V Ref High and V Ref Low, are also measured and reported bythe sensor, one near the top and one near the bottom of the analogsignal range, these data being necessary to enable the controller 40 todecode the telemetered data. Finally, a signal, V temp, representing thetemperature of the electronics package is available for transmission tothe controller 40 upon command.

Referring to FIG. 9, an eight-channel analog multiplexer 134 undercommand of a three-bit digital word from the controller selects one fromamong an ensemble of eight analog input channels 136 and connects it tothe input of voltage to frequency converter 135. The output of converter135 is a symmetric square wave whose frequency is directly proportionalto the analog input voltage. This signal is well suited for transmissionthrough the probe chain to the controller 40, where it is decoded bycounting techniques and interpreted with respect to reference signalstransmitted through the same chain. Two of the analog input signals tothe multiplexer are auxiliary outputs of the converter 135. The signalflow is otherwise straight forward.

Referring to FIGS. 11 and 12, the liquid level sensing circuit consistsof a Metritape™ variable resistor 215 excited by a constant currentdiode 160. The resistance of the level sensor 215, and hence the voltageacross it, is proportional to the length of the sensor which is in air.The difference between the air height and the sensor overall height istaken to be the depth of liquid in the storage tank. A 10 ohm referenceresister 197 is inserted between the level sensor 215 and ground. Thevoltage across this resistor when excited by the 1 ma constant currentsource is a 10 mV level called low. This is done in preference to usingzero volts as a reference level to avoid requiring converter 135 tooperate at the extreme of its range.

The temperature sensors 210, 211 and 212 are semiconductor devices whichare two-terminal current sources that conduct a current which isproportional to the absolute or Kelvin temperature with a nominal scalefactor of 1 microamp per degree Kelvin. For temperature 1, the sensor210 is read out by converting its current into the voltage acrossgrounded resistor 187. Variable resistor 168 is a scale factor trimwhich is employed as a single point calibration adjustment. The resultis a scale factor of 1 millivolt/degree Kelvin. Temperatures 2 and 3 areread similarly.

The water/hydrocarbon sensor circuit consists of a multivibrator, analternating-current conductance-sensing circuit, and a half-waverectifier and filter circuit. A conventional CMOS free-runningmultivibrator is formed by inverters 152 and 153, resistor 181, andcapacitor 173. A square wave at about 500 Hz is present at the output ofinverter 153. When the conducting tips 217 and 218 are in air or oil,capacitor 175 is effectively not in the circuit and the square waveappears at the input of inverter 154 and the output of inverter 155.Diode 162 and capacitor 176 form a peak detector which is discharged byresister 194. When the square wave is present at the output of inverter155, a high level is present at the input of inverter 156 and hence atthe output of inverter 157. When water is present between the conductingtips 217 and 218 capacitor 175 is effectively connected to ground andthe voltage at the input of inverter 154 does not have time to risesignificantly from the low level to which it is set by the conduction ofdiode 161; that is, there is insufficient current flow through resister186 to charge capacitor 175 during the positive half period of themultivibrator. In effect, the square wave is shorted to ground bycapacitor 175 and the water conductance across the conducting tips 217and 218. Accordingly, diode 162 does not conduct and a low level obtainsat the input of inverter 156 and at the output of inverter 157, thelatter of which constitutes the logic signal which indicates that wateris present. The circuit output switches sharply at a conducting tipresistance of about 150K ohm. The threshold resistance can be increasedby increasing the value of resister 186.

An eight channel analog multiplexer integrated circuit 134 suffices forthe level sensor, though the other multiplexer 151 is available ifexpansion to more channels is desired. The outputs (pin 3) of themultiplexers 134 and 151 are hardwired together because a high level onthe inhibit line (pin 6) of the deselected chip places all of its analogswitches in the high impedance state.

The voltage to frequency converter integrated circuit 135 produces asquare wave logic signal output having a frequency that is proportionalto the analog input signal voltage with a nominal scale factor of 10KHertz/volt. As used in this circuit, the input impedance seen by theanalog input source is about 250 megohms, with an input bias current of100 na. Therefore, errors due to loading and input current are less than0.1% and are thus negligible. In order to secure the maximum dynamicrange of which the converter 135 is capable, it is necessary to null theinput amplifier. This is accomplished with potentiometer 165.

The scaling equation relating output frequency to input signal voltagein this circuit is: F out=Vin/10 (resistance 183+resistance167)×capacitance 172. Potentiometer 167 is used to adjust the scalefactor. The V/F converter 135 provides the voltage reference output onpin 7 which is specified as 1 volt±5%. Potentiometer 166 is used tocreate a precise 900 mV±1 mV reference called Vref high, which isconnected to the multiplexer 134 at pin 4.

Another output signal from the converter 135 is a thermometer outputrepresenting the chip absolute temperature with a scale factor of 1 mV/°K±2%. The initial calibration is specified as raiseline accurate within±5 Kelvin degrees at room temperature. This reference output isconnected to the multiplexer 134 at pin 2 and is used to indicate thetemperature of the sensor module electronics package. This temperaturemay be used by processor 90 in a conventional fashion to correct thereceived converter frequency as indicated in the manufacturer'sspecifications provided with the VCO chip. Such correction is notnecessary if the voltage levels provided to the voltage controlledoscillator are spaced more widely than the changes in frequency due totemperature and/or if the probe circuit temperature is relativelystable.

Turning now to a summary of the function of the liquid sensor module ofFIGS. 10, 11, 13 and 14, in conjunction with the controller 40 and theprobe communication system; the purpose of the liquid sensor module 149is to detect the presence of liquid and determine whether the liquid ishydrocarbon or water. A float switch 224 detects that liquid is present;an electrical conductance circuit 140 discriminates between hydrocarbonand water. These two inputs to a logic circuit 142 determine which ofthree analog levels is presented to voltage-to-frequency-converter 147.The resulting one of three frequencies is transmitted through the probechain to the controller 40 to be decoded by a counting technique.Referring to the block diagram in FIG. 10, a water/hydrocarbon sensor140 gives a logic signal which is high when electrical resistivitybetween conducting tips 221 and 222 is above a threshold value (about150K ohm) and low when the resistivity is below the threshold. Thus alow output signifies that water is present between the tips. The floatswitch 224 generates a logic signal signifying that flotation hasoccurred. A logic circuit processes these two inputs and controls ananalog switch 143 to connect one of three analog levels generated byvoltage divider 144 to multiplexer 134. Input signals from thecontroller 40 control the analog channel selected by the multiplexer134. In the liquid sensor 149, four multiplexer channels 146 areutilized; they are: air-oil-water signal, reference voltage (nominal 1volt); zero volt reference; and thermometer output signal. Converter 147generates a symmetric square wave of a frequency which is directlyproportional to the analog voltage output of multiplexer 134. Thissquare wave signal is suitable for transmission thru the Communicationmodule chain to the processor in the controller 40. The proportionalityconstant is nominally 10K Hertz/volt. Two analog output signals are alsogenerated by the converter 147: a one-volt reference level which is usedto drive voltage divider 144; a thermometer signal which is directlyproportional to the absolute (Kelvin) temperature of the converterintegrated circuit chip 147, and which has a proportionality constant of1 millivolt/degree Kelvin. The latter signal is used to monitor thetemperature of the fluid sensor electronics package. Referring to FIG.11, because of commonality of function, both the liquid sensor 149 andthe level sensor 139 are constructed on the same printed circuit boardby suitable inclusion or omission of components and suitable placementof three jumper connections 201, 202 and 203. The curved dashed lines onthe schematic diagram indicate the required jumper connections for theliquid sensor 149; the solid curved lines are the jumpers for the levelsensor 139. The water/hydrocarbon sensor circuit 140 operates asdescribed above in the discussion of the level sensor 139 to produce alogic signal at the output of inverter 157 which is applied to pin 10 oflogic/switch 151 in the liquid sensor embodiment.

The float switch 224 is a magnetically actuated single-pole single-throwswitch which is connected to the grounded electrode tip 221 in the floatassembly 225 when no liquid is present. Flotation causes the floatswitch 224 to open. The switch is connected to Vbb through resister 198and, via the dashed jumper 201, to pin 11 of logic/switch 151, a channelselect input. Hence flotation causes a high level at pin 11. The outputof the water/hydrocarbon sensor circuit connects via dashed jumper 202to pin 10, another channel select input of logic/switch 151. Pin 9 oflogic/switch 151 is held low by software commands from the controller40. Integrated circuit logic/switch 151 is a multiplexer chip which isused in the fluid sensor both as logic circuit 142 and as multipoleanalog switch 143. Its channel select inputs are exploited for theirability to do simple logic on two binary input signals and express theresult by selecting one from the ensemble of analog input signalsconnected to the channel inputs. The voltage divider circuit 144provides voltage levels of 0.75, 0.5 and 0.25 volts to pins 12, 13, 14and 15 respectively of logic/switch 151. The logic is such as to producethe relationship codified in Table 1 between conditions and analogvoltages at the output, pin 3, of logic/switch 1.

                  TABLE 1                                                         ______________________________________                                                Logic   Logic             Frequency of VF                                     Input   Input   Analog Switch                                                                           Converter Output                            Condition                                                                             pin 11  pin 10  Output pin 3                                                                            pin 9                                       ______________________________________                                        Air     Low     High    .25   Volt  2048 Hz                                   Oil     High    High    .5          4096 Hz                                   Water   High    Low     .75         6144 Hz                                   ______________________________________                                    

The output of pin 3 is applied as the analog input signal to voltage tofrequency converter 147, pin 2. Output frequencies as shown in Table 1are produced in response to the detected conditions. Note that theoutput pins 3 of the two multiplexer chips 151 and 134 are hardwiredtogether; this is feasible because the inhibit input, pin 6, is undersoftware control. When the inhibit input is high all analog switches goto the high impedance state. Converter 147 also provides a referencevoltage of 1.0 volt on its pin 4 which is used to drive the voltagedivider 144 and is connected to multiplexer 134, pin 4, so that it maybe monitored by the controller 40. Converter 147 also produces athermometer output signal on its pin 3 which is an analog signalproportional to the absolute or Kelvin temperature of the V/F chip witha scale factor of 1 mV/° K. This signal also connects to multiplexer 134at pin 2. The scale factor of the converter 147 is set by capacitor 171and resistor 180 according to the relation: F =V/10×resistance180×capacitance 171, with the values shown, the s scale factor is 10KHz/volt. Note that capacitor 171 should be mounted close to the pins towhich it connects to avoid errors due to pickup and stray capacitance.

The above description of the sensor module for the liquid level probeand the liquid probe is exemplary. From the description it should eclear that any sensing element that has an output signal in the form ofa voltage can be incorporated into such a probe by adjusting it to anappropriate voltage level, gating the voltage with a multiplexer orsimilar gate, applying the voltage to a voltage to frequency converter,and applying the resulting output of the converter to a communicationmodule as described above. In the preferred embodiment such a circuit isprovided for the vapor probe 26 and the line pressure probe 23. Thevapor probe electronics to produce the above-mentioned voltage level ispreferably as described in U.S. patent application Ser. No. 098,561while the mechanical packaging and method for installing it between thewalls of a double-walled tank is as described in U.S. Pat. No.4,779,450. The line pressure sensor 23C is preferably a sensorincorporating an electronic circuit as described in U.S. patentapplication Ser. No. 07/134,694 to produce two voltages, one indicatinga trip point at about 3 psi and another indicating a trip point of about7 psi. These voltages are presented to a logic circuit and analogueswitch similar to those shown in FIG. 10 to provide the signals to themultiplexer (such as 134) which are passed on to the controller. Thesesignals from the line pressure probe 23 also comprise an internal liquidsignal.

Turning now to FIG. 17, a block diagram of the flow unit 22 is shown.The unit comprises flow meter 22A, overflow gauge 22C, flow meterinterface 250, overflow interface 252, microprocessor 255 and RS232 port257. The flow meter is preferably a high accuracy turbine flow metersuch as a Cox model No. F-3/4 manufactured by the Schutte and KoertingDivision of Ametek, Inc., 3255 W. Stetson Avenue, Hemet, Calif. 92343although other conventional flow meters may be used. Overflow gauge 22Cis preferably a model No. 73 made by Magnetrol International, 4300Belmont Road, Downers Grove, Ill. 60515. although other conventionaloverflow gauges may be used. The output of the preferred flow meter 22Ais a series of pulses of a frequency which is proportional to the flowrate through the flow meter. Thus, the signal received by flow meterinterface 250 is similar to that received by status signal interface 96and can be handled similarly. In this case however, the reset strobe ispreferably initiated either by a keyboard command communicated via cable32, port 257, and microprocessor 255 prior to delivery. The output ofoverflow gauge 22C is a voltage signal of a predetermined voltage level,and, therefore, interface 252 is a simple voltage bridge which adjuststhe input voltage to a suitable level for input to microprocessor 255.Microprocessor 255 is preferably a type HD63701VOP or HD6301V1, both ofwhich are made by Hitachi, although many other microprocessors could beused. Its primary function is to store the output of the flow meter 22Abetween interruptions from the controller 40; preferably it alsoperforms averaging and corrections that would otherwise have to be doneby controller processor 90, thus saving controller time for monitoringfunctions. RS232 port 257 communicates between microprocessor 255 andthe controller RS232 interface 97. The signal from flow unit 22 alsocomprises an internal liquid signal.

Turning now to FIGS. 17 and 19 through 23, the flow charts of thepreferred controller processor programs are shown. The main program issummarized in FIG. 17. The program initializes the system and performsmaintenance routines after it is turned on. These initializations andmaintenance routines are conventional and will not be discussed herein.These routines preferably contain a timing interrupt as described, forexample, in U.S. Pat. No. 4,736,193. Whenever a specified key onkeyboard 51 is hit, such as the exit key, the software enters theprogram mode in which the system may be programmed. Such a program modeis described in the above patent application, and may be modified asnecessary to carry out any desirable programming of the system. The mainprogram is interrogated approximately once each minute and enters themonitor mode which is shown in FIG. 19. In the monitor mode, the flowunit 22 is interrupted to see if the flow meter is running. If it is,the program enters a fill mode subroutine which checks the level gaugeevery five seconds. When the high alarm of the level gauge indicatesthat the tank is approaching full, the system enters a tank full modeand checks the overflow gauge then goes into alarm mode in whichappropriate visual and audio signals of the approaching full conditionare provided. The system will continue checking the overflow gauge atfive second intervals until the flow meter shuts off. Thereafter thesystem will recommence checking the overflow gauge 22C each time theflow meter turns on, until the tank liquid level falls below the highlevel alarm of the level gauge and deactivates the high level alarm.When the flow meter turns off, the system checks the level gauge andoverflow gauge one more time then progresses to monitor the linepressure probes, the external probes, and the annular space probes. Thepreferred programs for these monitoring functions are shown in FIGS. 20,21 and 22 respectively.

As discussed above, the preferred line pressure probe 23 returns asignal that differentiates between three pressure levels, i.e. less thenabout 3 psi, between 3 psi and 7 psi, and above 7 psi. The program setsa low line pressure flag whenever the line pressure drops below 7 psiand a line leak flag whenever the line pressure drops below 3 psi. Theseflags are utilized in the alarm program to provide alarms and alsoprovide additional decision criteria which are incorporated into theexternal probe and tank inventory mode subroutines. The line pressuresubroutine is called each time the line pressure clock times out. Theclock is a programmable software clock which is preferably set to about2 minutes.

The external probe subroutine is shown in FIG. 21. This subroutine iscalled each time the external probe clock times out; this software clockis also preferably set to about time out at about 2 minute intervals.This subroutine utilizes the stored decision criteria provided by datainput by various probes and sensors and by other subroutines (in theform of flags) to provide a more reliable and more detailed response tostorage system leaks than could be provided by any prior art leakdetection system. If there are no probes alarming the system simplyrecords this fact and returns to the monitor mode subroutine. If one ormore probes report a hydrocarbon condition, the subroutine checks to seeif a loss flag has been set, i.e. whether the tank inventory subroutine(see below) has determined a tank volume loss or the line pressuresubroutine has determined a line loss. If so, than a major leak flag isimmediately set. The major leak flag is also set if more than one probeis reporting a hydrocarbon condition. Otherwise the leak flag is set.Next the program checks to see if an overflow flag has been set, and ifso it sets the spill flag indicating that a spill (as opposed to a leak)has likely occurred. Finally the program checks if a low line pressureflag has been set, and if so the low line pressure location (assumingmore than one line pressure probe in the system) are compared with theprobes reporting hydrocarbon conditions and if any correlate, line leaklocation flags are set which are used to provide indications on printer41 and display 42 (or via peripherals 49) showing the location of theleaks.

The annular space probe checks subroutine is shown in FIG. 22. Thissubroutine is called up by a programmable software clock that ispreferably set to about 4 minutes. If the annular space probes, such as26, do not report any hydrocarbon presence, the system returns tomonitor mode. If a probe is reporting the hydrocarbon condition, thehydrocarbon in annular space flag is set. If there is also a tank volumeloss flag set for the same tank then the major leak flag is set. If anexternal leak flag is set, and the leak correlates with the tank inwhich the annular probe is reporting hydrocarbon, then a tank failureflag is set indicating that both the inner and outer tanks have beenpenetrated.

The tank inventory program which forms part of the main program is shownin FIG. 23. This program is returned to wherever the processor 40 is notperforming other tasks, and continually recycles itself so long as themicroprocessor is not called on to do other tasks. Generally, the fullcalculation to complete this program will take several minutes ofprocessor time. If either the dispensing pumps or the fill flow meterare operating, the program will read and record the necessary data thendeviate to a short-form calculation which estimates the tank volume. Ifa tank volume loss is found in the estimate mode an estimated volumeloss flag is set. This flag is sufficient to set off alarm indicationswhen it shows up in combination with other leak or loss flags, such asin the external leak probe and annular leak probe monitoring programs,but will not of itself cause the system to go into alarm. If both thedispense and input flow meters are not operating, the system does a fullaccuracy calculation of the tank volume. This calculation is such thatit is based on previous calculations and thus during long periods ofpumps and meter shutdowns, such as overnight, very accurate inventorycalculations can be made. Even in the accurate mode, the system will notsound an alarm the first time a tank volume loss or gain is calculated,unless there is a leak flag set, in which case the volume loss flag isimmediately set and the system goes to the alarm program. If no leakflag is set, then the system will set the volume loss flag and go intoalarm whenever two gains or two losses in a row are calculated with nointervening calculations showing no gain or loss.

The alarm program is shown in FIG. 24. The program provides appropriateaudio and visual indications of the various alarm conditions that havebeen flagged. These indications may vary from installation toinstallation and may be programmed into the memory 91 via keyboards 92(50,51). Such indications are known in the art and will not be discussedin detail herein. The alarm program also places a record of the alarmevent in memory 91. This record may be assessed via keyboards 92 orremote terminal 49. When the appropriate indications have been given andthe record stored, the system returns to the program it exited.

As has been described above, the combination of the external andinternal sensors in one system permit more detailed analysis of the tanksituation. Moreover, as has been disclosed, the combined system makes itpossible to discard alarms that may be suspect. Further, the combinedsystem permits probes to be set at more sensitive detection levelswithout increasing, and even decreasing false alarms. In particular, theinventory calculation can in practice be made much more accurately; thisis believed to be due to the increased information serving to smooth outthe errors in the calculation in much the same way that information onadditional variables improve the accuracy of calculation of the solutionof simultaneous equations. Thus the accuracy and reliability of thecombined system is increased much more dramatically than would beexpected from simply adding together the capabilities of the twoindependent systems.

A novel tank inventory and leak detection system which makes electronictank gauging practical has been described which has many otheradvantages. It is evident that those skilled in the art may now makemany uses and modifications of the specific embodiment described withoutdeparting from the inventive concepts. For example, different level,leak and other probes may be used. The software may be reconfigured, forexample, with the decision criteria being employed in the alarm programin some instances rather than in the Monitoring Mode. Equivalentelectronic components and circuits may be substituted. Consequently, theinvention is to be construed as embracing each and every novel featureand novel combination of features present in the fluid status detectionsystem described.

What is claimed is:
 1. Tank inventory and leak detection apparatus fordetecting the status of a liquid storage system and its contents, saidapparatus comprising:external detection means for detecting one or moreconditions of liquid external of said storage system and for providingan external liquid signal; internal detection means for detecting one ormore conditions of liquid internal of said storage system and forproducing an internal liquid signal; means for storing decision criteriarelating one or more of said external liquid conditions and one or moreof said internal liquid conditions; and indicating means communicatingwith said means for storing and responsive to said external liquidsignal and said internal liquid signal for providing an indication ofthe status of said liquid storage system and its contents.
 2. Theapparatus of claim 1 wherein said external detection means comprises acollecting means for detecting the presence of small quantities ofhydrocarbon liquid.
 3. The apparatus of claim 2 wherein said externaldetection means further comprises float means configured to fit withinsaid collecting means and occupy the major portion of its volume at theliquid-float interface, and a sensing means attached to said float forproviding said external liquid signal.
 4. The apparatus of claim 2wherein said external detection means comprises a vapor sensor and ameans for locating said vapor sensor between the walls of and near thebottom of said double-walled tank.
 5. The apparatus of claim 2 whereinsaid internal detection means comprises measurement means for measuringthe quantity of liquid in said storage system.
 6. The apparatus of claim5 wherein said measurement means comprises liquid level means formeasuring the liquid level in the storage system and at least onetemperature sensor means for sensing the temperature of the liquid inthe storage system.
 7. The apparatus of claim 1 wherein said means forstoring comprises means for storing decision criteria for determiningthe location of a leak in said liquid storage system and said indicatingmeans includes means for indicating the location of said leak in saidliquid storage system.